import QtQuick



Window {
    width: 1200
    height: 600
    visible: true
    title: qsTr("自定义菜单")



    Connections {

        target: topNavBar
        function onNavBarClickMessage( n, message,index){

            GlobalModel.clickType=n
            GlobalModel.curShowNavBar=index
             console.log("signal:ctype="+GlobalModel.clickType+";"+GlobalModel.curShowNavBar+";"+message)
        }
    }

    /*
    Connections {
        target: navMenu
        function onMenuItemClickMessage(n,message){
            console.log("signal:"+n+";"+message)
            GlobalModel.clickType=n
        }
    }
    */

    Connections{

        target: topNavBar
        function onChangeNavBarShowMenu(oldVal,newVal){
            GlobalModel.curShowNavBar=newVal;
            console.log("navBarChange:sbar="+oldVal+":"+newVal)
        }
    }


    Nav {
        id:topNavBar
        navLabNum: 5
        width: parent.width
        height: parent.height
        z:2
    }

    Rectangle {
        id:midBar
        width: parent.width
        height: 80
        anchors.left: topNavBar.left
        anchors.top: topNavBar.top
        anchors.topMargin: topNavBar.getRootHeight()

        color: "grey"
        z:0
    }

    Rectangle {
        id:leftBar
        width: 100
        height: parent.height-(topNavBar.getRootHeight()+midBar.height)
        anchors.left: midBar.left
        anchors.top: midBar.top
        anchors.topMargin:midBar.height
        color: "orange"
        z:0
    }

    TableContext{
        id:rightContext
        width:parent.width-leftBar.width
        height: parent.height-(topNavBar.getRootHeight()+midBar.height)
        anchors.left: leftBar.right
        anchors.top: leftBar.top
        color: "yellow"

    }
}
